<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>注册</title>

<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<link href="/css/base.css" type="text/css" rel="stylesheet" />
<link href="/css/manage.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/js/jquery.default.js"></script>
<script type="text/javascript" src="/js/jquery.validate.js"></script>
<!--[if ie]><link href="/css/ie.css" type="text/css" rel="stylesheet"><![endif]-->
</head>

<body>
	<!-- head -->
    <?php $this->load->view('head');?>
    <!-- head--end-->
    
    <!-- nav_tit -->
    <div class="w100p">
    	<div class="w903 mg">
        	<div class="nav_tit">
            	小时候的胡同，现在的马路？大商场的繁华，街边小店的幽静，你更喜欢哪个？来吧，我们一起走街串店.......
            </div>
        </div>
    </div>
    <!-- nav_tit--end-->
    
    <!-- body -->
    <div class="w100p mb20">
    	<div class="w903 mg">
        	<div class="box_s1">
            	<div class="b_head"></div>
                <div class="content lr_pd_s1">
                	<div class="login_box reg">
                    	<h3 class="title">注册</h3> 
                        <div class="reg_box">     
                        	<form action="<?php echo site_url('member/reg')?>" method="post" id="reg_form">
                            <table class="com_form">
                                <tr>
                                    <td width="92" class="col1">*电子邮件</td><td><input type="text" name="email" class="def_txt_s3" /><br class="clear" /><div class="validate_v" ></div></td>
                                </tr>
                                <tr>
                                    <td width="92" class="col1">密码</td><td><input type="password" id="password" name="password" class="def_txt_s3" /><br class="clear" /><div class="validate_v" ></div></td>
                                </tr>
                                <tr>
                                    <td width="92" class="col1">再次输入密码</td><td><input type="password" name="rpassword" class="def_txt_s3" /><br class="clear" /><div class="validate_v" ></div></td>
                                </tr>
                                <tr>
                                    <td width="92" class="col1">*用户名</td><td><input type="text" name="username" class="def_txt_s3" /><br class="clear" /><div class="validate_v" ></div></td>
                                </tr>
                                <tr>
                                        <td width="92" class="col1">*密码提示问题</td>
                                        <td>
                                            <div class="select_wrap" style="z-index:100">
                                                <div class=" def_drop drop"><span>请选择密码提示问题</span></div>
                                                <input type="hidden" name="pas_tip" />
                                                <br class="clear" /><div class="validate_v" ></div>
                                                <div class="select_data_box select" style=" display:none;" >
                                                	<?php foreach ($qstTipList as $qstTip):?>
                                                		<p dataid="1" datavalue="<?php echo $qstTip['code']?>"><?php echo $qstTip['value']?></p>
                                                	<?php endforeach;?>
                                                    
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                <tr>
                                    <td width="92" class="col1">*密码提示答案</td><td><input type="text" name="answer" class="def_txt_s1" /><br class="clear" /><div class="validate_v" ></div><span class="tip_1">密码保护信息用于取回密码以及处理其他账户问题，请您谨慎填写并牢记</span></td>
                                </tr>
                                <tr>
                                	<td width="50" class="col1">验证码</td><td><input type="text" name="captcha" class="def_txt_s2" /><img src="<?php echo $cap['image'] ?>" id="captcha_img" class="yzm" style="margin-top: 2px;cursor: pointer;" /><span class="tip">点击图片换一张</span><br class="clear" /><div class="validate_v" ></div></td>
                                </tr>
                                <tr>
                                    <td width="92" class="col1"></td><td><input type="checkbox" style="float: left;margin-top: 3px;" name="protocal" id="protocal" /><label class="tip protocol" for="protocal">我已经阅读并同意<服务协议></label><br class="clear" /><div class="validate_v" ></div></td>
                                </tr>
                                <tr>
                                    <td width="92" class="col1"></td><td><div class="mt10"><input type="submit" class="def_btn_s5 mr10"  value="免费注册" /><input type="button" class="def_btn_s6" onclick="window.location.href='<?php echo base_url('member/tologin')?>'" value="您已经注册，请登录" /></div></td>
                                </tr>
                            </table>
                            </form>
                        </div>   
                        
                    </div>
                    
                </div>
                <div class="b_foot"></div>
            </div>
        </div>
    </div>
    
    <!-- body--end-->
    
    <!-- foot-->
   <?php $this->load->view('foot')?>
    <!-- foot--end-->	
    
    <script type="text/javascript">
    /*
    	function reg(){
			document.getElementById("reg_form").submit();
        }
    */
    	$(function(){
			$("#captcha_img").click(function(){
				$.post("<?php echo site_url("member/loadcap")?>",function(data){
						var ret = $.parseJSON(data);
						$("#captcha_img").attr("src",ret.image);
					});
			});


			
			$.validator.addMethod("stringCheck", function(value, element) {          
				return this.optional(element) || /^[\u0391-\uFFE5\w]+$/.test(value);       	
			}, "只能包括中文字、英文字母、数字和下划线");  
		
			$("#reg_form").validate({
				rules:{
					email:{
						required:true,
						email:true
					},
					password:{
						required:true
					},
					rpassword:{
						required:true,
						equalTo:"#password"
					},
					username:{
						required:true
					},
					pas_tip:{
						required:true
					},
					answer:{
						required:true
					},
					protocal:{
						required:true
					},
					captcha:{
						required:true
					}
					
				},
				messages:{
					email:{
						required:"邮箱不能为空！",
						email:"邮箱格式错误！"
					},
					password:{
						required:"密码不能为空！"
					},
					rpassword:{
						required:"密码不能为空",
						equalTo:"两次密码输入不一致，请重新输入！"
					},
					username:{
						required:"用户名不能为空！"
					},
					pas_tip:{
						required:"密码提示问题不能为空！"
					},
					answer:{
						required:"密码提示回答不能为空！"
					},
					protocal:{
						required:"请同意协议"
					},
					captcha:{
						required:'请输入验证码'
					}
				},
				errorPlacement:function(error,element){
					error.appendTo(element.siblings("div.validate_v"));
				}
			});
			
        })
    </script>
</body>
</html>
